﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Themes/Default/Views/Shared/Site.Master"%>

<%@ Import Namespace="AFDS.BusinessLogic" %>
<%@ Import Namespace="AFDS.BusinessLogic.Helpers" %>
<%@ Import Namespace="AFDS.Core" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<% Html.RenderPartial("AFDSSubMenu");%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">    

<fieldset class="MvcMembership">
	<legend><%=ViewData["Title"] %></legend>

<% Site site = (Site)ViewData["Site"]; %>    
        
    <%if (!string.IsNullOrEmpty(site.Image)){%>    
        <div style="width:350px; float: right;">
		    <img src="~/img.axd?picture=<%=site.Image %>&amp;width=330" />		
		</div>
   <%}%>		


<% Html.BeginForm("EditSite", "AFDSAdmin"); %>      
        <%=Html.Hidden("id", site.Id.ToString())%>
        <%=Html.Hidden("actionType", ViewData["actionType"])%>
        <label for="name">Name:</label>
        <input id="name" name="name" type="text" value="<%=site.Name %>" />

        <label for="url">Url:</label>
        <input id="url" name="url" type="text" value="<%=site.URL %>" />                 
        <label for="description">Description:</label>
        <input id="description" name="description" type="text" value="<%=site.Description %>" />               
        <label for="firstname">FirstName:</label>
        <input id="firstname" name="firstname" type="text" value="<%=site.FirstName %>" />               
        <label for="lastname">LastName:</label>
        <input id="lastname" name="lastname" type="text" value="<%=site.LastName %>" />                                                  
		    <label for="cbcategory">Category:</label>				
            <%=Html.DropDownList("Key", (SelectList)ViewData["cbCategories"])%>						                               
            
        <label for="email">E-Mail:</label>
        <input id="email" name="email" type="text" value="<%=site.EMail %>" />            
		    <label for="approved">Is Approved:</label>
		    <input type="checkbox" id="approved" name="approved" <% =bool.Parse( ( site.Approved.ToString() ?? true.ToString() ).ToString() ) ? "checked=\"checked\"" : "" %> />                								                               
		<br />
		<input type="submit" value="<% = ViewData["actionType"]%>" /> 
<% Html.EndForm(); %>      

</fieldset>

</asp:Content>
